using SmartCommunity.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace SmartCommunity.WebApi.Controllers
{
    [AllowAnonymous]
    [ApiController]
    [Route("[controller]")]
    public class PublicController : BaseController
    {
        private readonly ILogger<PublicController> _logger;
        private readonly SCDBContext ctx;

        public PublicController(ILogger<PublicController> logger, SCDBContext ctx)
        {
            _logger = logger;
            this.ctx = ctx;
        }

        [HttpGet("test")]
        public IActionResult Get()
        {
            var parent = ctx.Users.ToList();
            var obj = parent.Where(a => a.UserId == 100);
            return Ok(obj);
        }
    }
}
